﻿<Window x:Class="Adan.Client.Dialogs.OptionsDialog"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Controls="clr-namespace:Adan.Client.Controls"
        xmlns:local="clr-namespace:Adan.Client.Dialogs.Fonts"
        Title="Options" 
        ResizeMode="NoResize" 
        WindowStartupLocation="CenterOwner" 
        mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
        Width="510"
        Height="300" 
        xmlns:Utils="clr-namespace:Adan.Client.Common.Utils;assembly=Adan.Client.Common"
        xmlns:controls="clr-namespace:Adan.Client.Common.Controls;assembly=Adan.Client.Common"
        Style="{StaticResource DefaultWindowStyle}" ShowInTaskbar="False">
    <Window.Resources>
        <Utils:InverseBooleanConverter x:Key="InverseBooleanConverter" />
    </Window.Resources>
    <Grid Margin="2">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <TabControl Margin="0,0,0,10">
            <TabItem Header="Common" >
                <Grid Margin="10,10,0,0">
                    <Grid.ColumnDefinitions >
                        <ColumnDefinition Width="179*"/>
                        <ColumnDefinition Width="311*"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="103*"/>
                        <RowDefinition Height="110*"/>
                    </Grid.RowDefinitions>
                    <Label Content="Cursor while listing history" HorizontalAlignment="Left" VerticalAlignment="Top" Height="13" Width="136"/>
                    <RadioButton IsChecked="{Binding Path=StartOfLine}" GroupName="CursorHistory" Content="Start of line" HorizontalAlignment="Left" Margin="9,23,0,0" VerticalAlignment="Top" Height="16" Width="88"/>
                    <RadioButton IsChecked="{Binding Path=EndOfLine}" GroupName="CursorHistory" Content="End of line" VerticalAlignment="Top" Margin="9,44,0,0" HorizontalAlignment="Left" Height="16" Width="88"/>
                    <Label Content="Command char" Margin="0,10,0,0" Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Top" Height="13" Width="82"/>
                    <Label Content="Command delimiter" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,46,0,0" Grid.Row="1" Height="13" Width="110"/>
                    <Controls:OneCharTextBox Text="{Binding Path=CommandChar}" MaxLength="1" HorizontalAlignment="Left" Height="23" TextWrapping="Wrap" VerticalAlignment="Top" Width="21" Margin="115,5,0,0" Grid.Row="1"/>
                    <Controls:OneCharTextBox Text="{Binding Path=CommandDelimiter}" MaxLength="1" HorizontalAlignment="Left" Height="23" TextWrapping="Wrap" VerticalAlignment="Top" Width="21" Margin="115,39,0,0" Grid.Row="1"/>
                    <Label Content="Min string length in history" Grid.Column="1" HorizontalAlignment="Left" Margin="10,4,0,0" VerticalAlignment="Top" Height="13" Width="138"/>
                    <Label Content="History size" Grid.Column="1" HorizontalAlignment="Left" Margin="10,32,0,0" VerticalAlignment="Top" Height="13" Width="67"/>
                    <controls:NumberTextBox Text="{Binding Path=MinLengthHistory}" Grid.Column="1" HorizontalAlignment="Left" Height="23" Margin="207,4,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="81"/>
                    <controls:NumberTextBox Text="{Binding Path=HistorySize}" Height="23" TextWrapping="Wrap" VerticalAlignment="Top" Grid.Column="1" Margin="207,32,23,0"/>
                    <CheckBox IsChecked="{Binding Path=AutoClearInput}" Content="Auto clear input" Grid.Column="1" HorizontalAlignment="Left" Margin="10,48,0,0" Grid.Row="1" VerticalAlignment="Top" Height="16" Width="107"/>
                    <CheckBox IsChecked="{Binding Path=AutoReconnect}" Content="Auto Reconnect" Grid.Column="1" HorizontalAlignment="Left" Margin="207,78,0,0" Grid.Row="1" VerticalAlignment="Top" Height="16" Width="104"/>
                    <CheckBox IsChecked="{Binding Path=AutoConnect}" Content="Auto Connect" Grid.Column="1" HorizontalAlignment="Left" Margin="207,48,0,0" Grid.Row="1" VerticalAlignment="Top" Height="16" Width="104"/>
                    <Label Content="Scroll buffer" Grid.Column="1" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Grid.Row="1" Height="13" Width="67"/>
                    <controls:NumberTextBox Text="{Binding Path=ScrollBuffer}" Grid.Column="1" HorizontalAlignment="Left" Height="23" Margin="207,5,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="81" Grid.Row="1"/>
                    <CheckBox IsChecked="{Binding Path=SettingsFolder}" Content="Save settings to My Documents" HorizontalAlignment="Left" Margin="10,78,0,0" Grid.Row="1" VerticalAlignment="Top" Grid.Column="1" Width="182"/>
                </Grid>
            </TabItem>
            <TabItem Header="Text">
                <Grid>
                    <Label Content="Color theme" HorizontalAlignment="Left" Margin="10,15,0,0" VerticalAlignment="Top" Height="23" Width="87"/>
                    <ComboBox Padding="5" ItemsSource="{Binding Path=AvailableColorThemes}" DisplayMemberPath="Name" SelectedValue="{Binding Path=SelectedTheme}" Margin="102,15,245,0" Height="23" VerticalAlignment="Top" />
                    <Label Content="MUD font" HorizontalAlignment="Left" Margin="10,45,0,0" VerticalAlignment="Top" Height="23" Width="87"/>
                    <ComboBox Padding="5" ItemsSource="{Binding AvailableFonts}" SelectedValue="{Binding SelectedFont}" Height="23" VerticalAlignment="Top" Margin="102,45,245,0" />
                    <ComboBox Padding="5" ItemsSource="{Binding AvailableFontSizes}" SelectedValue="{Binding SelectedFontSize}" Height="23" VerticalAlignment="Top" Margin="250,45,204,0" />
                    <Label Content="Weight" HorizontalAlignment="Left" Margin="10,75,0,0" VerticalAlignment="Top" Height="31" Width="87"/>
                    <ComboBox Padding="5" ItemsSource="{Binding AvailableFontWeights}" SelectedValue="{Binding SelectedFontWeight}" Height="23" Margin="102,75,245,0" VerticalAlignment="Top"/>
                  </Grid>
            </TabItem>
        </TabControl>
        <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Right">
            <Button Click="HandleOk" Margin="0,0,5,0" HorizontalAlignment="Right" IsDefault="True" MinWidth="50" Content="Ok"/>
            <Button HorizontalAlignment="Right" IsDefault="True" IsCancel="True" MinWidth="50" Content="Cancel"/>
        </StackPanel>
    </Grid>
</Window>
